import 'package:flutter/material.dart';

class AspectRatioDemo extends StatelessWidget {
  const AspectRatioDemo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(16),
      child: Center(
        child: Container(
          alignment: Alignment.center,
          child: AspectRatio(
            aspectRatio: 16 / 9,
            child: Image.network(
              "https://img1.baidu.com/it/u=558442588,3678075188&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=281",
              fit: BoxFit.cover,
            ),
          ),
        ),
      ),
    );
  }
}
